// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'
import VueAxios from 'vue-axios'
import "amfe-flexible";
import Vuex from 'vuex'
import $ from 'jquery'
import "./assets/fonts/iconfont.css"
import animated from 'animate.css'
import {
  Button,
  Tabbar,
  TabbarItem,
  Icon,
  Switch,
  Popup,
  Uploader,
  Swipe,
  SwipeItem,
  Lazyload,
  Rate,
  Sidebar,
  RadioGroup,
  Radio,
  SidebarItem,
  Tab,
  Tabs,
  Field,
  Toast,
  CountDown
} from 'vant';
Vue.use(Field);
Vue.use(CountDown);
Vue.use(Swipe);
Vue.use(SwipeItem);
Vue.use(Lazyload);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(Icon);
Vue.use(Rate);
Vue.use(Sidebar);
Vue.use(SidebarItem);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(animated)
Vue.use(Toast);
Vue.use(Uploader);
Vue.use(Popup);
Vue.use(Tabbar);
Vue.use(Switch);
Vue.use(Icon);
Vue.use(TabbarItem);
Vue.use(Button);
Vue.use(VueAxios, axios)
Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.use(Vuex)
/* eslint-disable no-new */
const store = new Vuex.Store({
  //state 存储存储器中的共享数据源,(各组件之间的共享的值)
  state: {
    allObj: {},
    historyList: [],
    // 控制tabbar的隐藏和显示
    showTab: false,
    idVal: "",
    balanceV: "",
    money: "",
    wink: "",
    arror: "",
    NewUser: "",
    adressV: [],
    homeAdress: [],
    allPlace: {}
  },
  mutations: {
    changeObj(state, a) {
      state.allObj = a //普通路由跳转
    },
    changeCityObj(state, a) {
      state.allObj = a //所有城市
    },
    changeVal(state, b) {
      state.searchCityVal = b //搜索城市
    },
    changeHistory(state, c) { //历史记录
      state.historyList = c
    },
    // 改变tabbar的显示和隐藏
    changeShowTab(state, showTab) {
      state.showTab = showTab
    },
    idResult(state, d) { //用户名
      state.idVal = d
    },
    balanceObj(state, f) { //跳转余额
      state.balanceV = f
    },
    changeMoney(state, g) { //返回个人,及改变money
      state.money = g
    },
    detailTz(state, j) { //公共跳转
      state.wink = j
    },
    arrorV(state, h) { //发送图片路径
      state.arror = h
    },
    UserVT(state, i) {
      state.NewUser = i
    },
    modifyUserName(state, j) {
      state.idVal = j
    },
    Add_Adress(state, k1) {
      state.adressV = k1;
      // state.adressV =k2;
    },
    sendAdress(state, l) {
      state.homeAdress = l
    },
    changePlace(state, m) {
      state.allPlace = m
    }
  }
})
new Vue({
  el: '#app',
  router,
  $,
  store,
  components: {
    App
  },
  template: '<App/>'
})
